<?php
namespace app\wp\controller;
class Upload extends Common{
    public function img(){
        $file = request()->file('file');
        $fold = ROOT_PATH . 'public' . DS . 'uploads';
        // 移动到框架应用根目录/public/uploads/ 目录下
        if($file){
            $info = $file->move($fold);
            if($info){
                echo $info->getSaveName();
            }else{
                return $file->getError() ;
            }
        }
    }
}